package com.kehutong.wxapi.request;

import org.coraframework.json.annotation.JSONField;

import java.util.List;

/**
 * 更新成员请求对象
 * @author: liukunlong
 * @date: 2021-03-08 16:03
 */
public class UserUpdateRequest {
    /**
     * 调用接口凭证
     */
    private String accessToken;
    /**
     * 成员UserID。对应管理端的帐号，企业内必须唯一。不区分大小写，长度为1~64个字节
     */ /**
     * userid : zhangsan
     * name : 李四
     * department : [1]
     * order : [10]
     * position : 后台工程师
     * mobile : 13800000000
     * gender : 1
     * email : zhangsan@gzdev.com
     * is_leader_in_dept : [1]
     * enable : 1
     * avatar_mediaid : 2-G6nrLmr5EC3MNb_-zL1dDdzkd0p7cNliYu9V5w7o8K0
     * telephone : 020-123456
     * alias : jackzhang
     * address : 广州市海珠区新港中路
     * main_department : 1
     * extattr : {"attrs":[{"type":0,"name":"文本名称","text":{"value":"文本"}},{"type":1,"name":"网页名称","web":{"url":"http://www.test.com","title":"标题"}}]}
     * external_position : 工程师
     * external_profile : {"external_corp_name":"企业简称","external_attr":[{"type":0,"name":"文本名称","text":{"value":"文本"}},{"type":1,"name":"网页名称","web":{"url":"http://www.test.com","title":"标题"}},{"type":2,"name":"测试app","miniprogram":{"appid":"wx8bd80126147dFAKE","pagepath":"/index","title":"my miniprogram"}}]}
     */

    @JSONField(name = "userid")
    private String userid;
    /**
     * 成员名称。长度为1~64个utf8字符
     */
    @JSONField(name = "name")
    private String name;
    /**
     * 成员所属部门id列表，不超过100个
     */
    @JSONField(name = "department")
    private List<Integer> department;
    /**
     * 部门内的排序值，默认为0。当有传入department时有效。数量必须和department一致，数值越大排序越前面。有效的值范围是[0, 2^32)
     */
    @JSONField(name = "order")
    private List<Integer> order;
    /**
     * 职务信息。长度为0~128个字符
     */
    @JSONField(name = "position")
    private String position;
    /**
     * mobile
     */
    @JSONField(name = "mobile")
    private String mobile;
    /**
     * 性别。1表示男性，2表示女性
     */
    @JSONField(name = "gender")
    private String gender;
    /**
     * 邮箱。长度不超过64个字节，且为有效的email格式。企业内必须唯一。若是绑定了腾讯企业邮箱的企业微信，则需要在腾讯企业邮箱中修改邮箱（此情况下该参数被忽略，但不会报错）
     */
    @JSONField(name = "email")
    private String email;
    /**
     * 上级字段，个数必须和department一致，表示在所在的部门内是否为上级。
     */
    @JSONField(name = "is_leader_in_dept")
    private List<Integer> isLeaderInDept;
    /**
     * 启用/禁用成员。1表示启用成员，0表示禁用成员
     */
    @JSONField(name = "enable")
    private Integer enable;
    /**
     * 成员头像的mediaid，通过素材管理接口上传图片获得的mediaid
     */
    @JSONField(name = "avatar_mediaid")
    private String avatarMediaid;
    /**
     * 座机。由1-32位的纯数字或’-‘号组成
     */
    @JSONField(name = "telephone")
    private String telephone;
    /**
     * alias
     */
    @JSONField(name = "alias")
    private String alias;
    /**
     * 地址。长度最大128个字符
     */
    @JSONField(name = "address")
    private String address;
    /**
     * 主部门
     */
    @JSONField(name = "main_department")
    private Integer mainDepartment;
    /**
     * 自定义字段。自定义字段需要先在WEB管理端添加，见扩展属性添加方法，否则忽略未知属性的赋值。与对外属性一致，不过只支持type=0的文本和type=1的网页类型，详细描述查看对外属性
     */
    @JSONField(name = "extattr")
    private ExtattrDTO extattr;
    /**
     * 对外职务，如果设置了该值，则以此作为对外展示的职务，否则以position来展示。不超过12个汉字
     */
    @JSONField(name = "external_position")
    private String externalPosition;
    /**
     * 成员对外属性，字段详情见对外属性
     */
    @JSONField(name = "external_profile")
    private ExternalProfileDTO externalProfile;


    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Integer> getDepartment() {
        return department;
    }

    public void setDepartment(List<Integer> department) {
        this.department = department;
    }

    public List<Integer> getOrder() {
        return order;
    }

    public void setOrder(List<Integer> order) {
        this.order = order;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public List<Integer> getIsLeaderInDept() {
        return isLeaderInDept;
    }

    public void setIsLeaderInDept(List<Integer> isLeaderInDept) {
        this.isLeaderInDept = isLeaderInDept;
    }

    public Integer getEnable() {
        return enable;
    }

    public void setEnable(Integer enable) {
        this.enable = enable;
    }

    public String getAvatarMediaid() {
        return avatarMediaid;
    }

    public void setAvatarMediaid(String avatarMediaid) {
        this.avatarMediaid = avatarMediaid;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getMainDepartment() {
        return mainDepartment;
    }

    public void setMainDepartment(Integer mainDepartment) {
        this.mainDepartment = mainDepartment;
    }

    public ExtattrDTO getExtattr() {
        return extattr;
    }

    public void setExtattr(ExtattrDTO extattr) {
        this.extattr = extattr;
    }

    public String getExternalPosition() {
        return externalPosition;
    }

    public void setExternalPosition(String externalPosition) {
        this.externalPosition = externalPosition;
    }

    public ExternalProfileDTO getExternalProfile() {
        return externalProfile;
    }

    public void setExternalProfile(ExternalProfileDTO externalProfile) {
        this.externalProfile = externalProfile;
    }

    public static class ExtattrDTO {
        /**
         * attrs
         */
        @JSONField(name = "attrs")
        private List<AttrsDTO> attrs;

        public List<AttrsDTO> getAttrs() {
            return attrs;
        }

        public void setAttrs(List<AttrsDTO> attrs) {
            this.attrs = attrs;
        }

        public static class AttrsDTO {
            /**
             * type
             */ /**
             * type : 0
             * name : 文本名称
             * text : {"value":"文本"}
             * web : {"url":"http://www.test.com","title":"标题"}
             */

            @JSONField(name = "type")
            private Integer type;
            /**
             * name
             */
            @JSONField(name = "name")
            private String name;
            /**
             * text
             */
            @JSONField(name = "text")
            private TextDTO text;
            /**
             * web
             */
            @JSONField(name = "web")
            private WebDTO web;

            public Integer getType() {
                return type;
            }

            public void setType(Integer type) {
                this.type = type;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public TextDTO getText() {
                return text;
            }

            public void setText(TextDTO text) {
                this.text = text;
            }

            public WebDTO getWeb() {
                return web;
            }

            public void setWeb(WebDTO web) {
                this.web = web;
            }

            public static class TextDTO {
                /**
                 * value
                 */ /**
                 * value : 文本
                 */

                @JSONField(name = "value")
                private String value;

                public String getValue() {
                    return value;
                }

                public void setValue(String value) {
                    this.value = value;
                }
            }

            public static class WebDTO {
                /**
                 * url
                 */ /**
                 * url : http://www.test.com
                 * title : 标题
                 */

                @JSONField(name = "url")
                private String url;
                /**
                 * title
                 */
                @JSONField(name = "title")
                private String title;

                public String getUrl() {
                    return url;
                }

                public void setUrl(String url) {
                    this.url = url;
                }

                public String getTitle() {
                    return title;
                }

                public void setTitle(String title) {
                    this.title = title;
                }
            }
        }
    }

    public static class ExternalProfileDTO {
        /**
         * externalCorpName
         */ /**
         * external_corp_name : 企业简称
         * external_attr : [{"type":0,"name":"文本名称","text":{"value":"文本"}},{"type":1,"name":"网页名称","web":{"url":"http://www.test.com","title":"标题"}},{"type":2,"name":"测试app","miniprogram":{"appid":"wx8bd80126147dFAKE","pagepath":"/index","title":"my miniprogram"}}]
         */

        @JSONField(name = "external_corp_name")
        private String externalCorpName;
        /**
         * externalAttr
         */
        @JSONField(name = "external_attr")
        private List<ExternalAttrDTO> externalAttr;

        public String getExternalCorpName() {
            return externalCorpName;
        }

        public void setExternalCorpName(String externalCorpName) {
            this.externalCorpName = externalCorpName;
        }

        public List<ExternalAttrDTO> getExternalAttr() {
            return externalAttr;
        }

        public void setExternalAttr(List<ExternalAttrDTO> externalAttr) {
            this.externalAttr = externalAttr;
        }

        public static class ExternalAttrDTO {
            /**
             * type
             */ /**
             * type : 0
             * name : 文本名称
             * text : {"value":"文本"}
             * web : {"url":"http://www.test.com","title":"标题"}
             * miniprogram : {"appid":"wx8bd80126147dFAKE","pagepath":"/index","title":"my miniprogram"}
             */

            @JSONField(name = "type")
            private Integer type;
            /**
             * name
             */
            @JSONField(name = "name")
            private String name;
            /**
             * text
             */
            @JSONField(name = "text")
            private TextDTO text;
            /**
             * web
             */
            @JSONField(name = "web")
            private WebDTO web;
            /**
             * miniprogram
             */
            @JSONField(name = "miniprogram")
            private MiniprogramDTO miniprogram;

            public Integer getType() {
                return type;
            }

            public void setType(Integer type) {
                this.type = type;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public TextDTO getText() {
                return text;
            }

            public void setText(TextDTO text) {
                this.text = text;
            }

            public WebDTO getWeb() {
                return web;
            }

            public void setWeb(WebDTO web) {
                this.web = web;
            }

            public MiniprogramDTO getMiniprogram() {
                return miniprogram;
            }

            public void setMiniprogram(MiniprogramDTO miniprogram) {
                this.miniprogram = miniprogram;
            }

            public static class TextDTO {
                /**
                 * value
                 */ /**
                 * value : 文本
                 */

                @JSONField(name = "value")
                private String value;

                public String getValue() {
                    return value;
                }

                public void setValue(String value) {
                    this.value = value;
                }
            }

            public static class WebDTO {
                /**
                 * url
                 */ /**
                 * url : http://www.test.com
                 * title : 标题
                 */

                @JSONField(name = "url")
                private String url;
                /**
                 * title
                 */
                @JSONField(name = "title")
                private String title;

                public String getUrl() {
                    return url;
                }

                public void setUrl(String url) {
                    this.url = url;
                }

                public String getTitle() {
                    return title;
                }

                public void setTitle(String title) {
                    this.title = title;
                }
            }

            public static class MiniprogramDTO {
                /**
                 * appid
                 */ /**
                 * appid : wx8bd80126147dFAKE
                 * pagepath : /index
                 * title : my miniprogram
                 */

                @JSONField(name = "appid")
                private String appid;
                /**
                 * pagepath
                 */
                @JSONField(name = "pagepath")
                private String pagepath;
                /**
                 * title
                 */
                @JSONField(name = "title")
                private String title;

                public String getAppid() {
                    return appid;
                }

                public void setAppid(String appid) {
                    this.appid = appid;
                }

                public String getPagepath() {
                    return pagepath;
                }

                public void setPagepath(String pagepath) {
                    this.pagepath = pagepath;
                }

                public String getTitle() {
                    return title;
                }

                public void setTitle(String title) {
                    this.title = title;
                }
            }
        }
    }
}
